import request from '@/utils/request'
const api_pre = `/admin/acl/role`
const deleteRoleById = (id) => {
    return request({
        url: `${api_pre}/remove/${id}`,
        method: 'delete',
    })
}
const getRole = (id) => {
    return request({
        url: `${api_pre}/get/${id}`,
        method: 'get',
    })
}
const getRoleList = (page, limit, searchObj) => {
    return request({
        url: `${api_pre}/${page}/${limit}`,
        method: 'get',
        params: searchObj
    })
}
const saveRole = (role) => {
    return request({
        url: `${api_pre}/save`,
        method: 'post',
        data: role
    })
}
const updateRole = (role) => {
    return request({
        url: `${api_pre}/update`,
        method: 'put',
        data: role
    })
}

export default {
    updateRole,
    saveRole,
    getRoleList,
    getRole,
    deleteRoleById,
}
